/*
 *  HeartBeatController.cpp
 *  project8
 *
 *  Created by Luca Gobbo on 21-06-10.
 *  Copyright 2010 __MyCompanyName__. All rights reserved.
 *
 */

#include "HeartBeatDetection.h"
                            
HeartBeatDetection::HeartBeatDetection(InfraredSensor * sensor):cTask("HeartBeatDetectionTask",0,5), theInfraredSensor(sensor) 
 {
 
}



void HeartBeatDetection::init(void){
    block();

}

void HeartBeatDetection::update(void){
    // std::cout << "hbdetection update";     
    if (theInfraredSensor->heartBeat()){
       
         theInfraredSensor->getListener()->heartBeat();
          
     }
    block();
}






